<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Weboffice</title>
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <style>
    iframe {
      width: 100%;
      height: 100%;
    }
  </style>
</head>

<body>
<script src="https://g.alicdn.com/IMM/office-js/1.1.19/aliyun-web-office-sdk.min.js"></script>
<div id="weboffice-zone"></div>
<script>
  const query = new URLSearchParams(window.location.search);
  const AccessToken = query.get('AccessToken');
  const WebofficeURL = query.get('WebofficeURL');
  window.onload = init;
  async function init() {
    // 填入Weboffice链接和预览凭证信息。
    weboffice({
      "AccessToken": AccessToken,
      "WebofficeURL": WebofficeURL
    })
  }
  function weboffice(tokenInfo) {
    let mount = document.getElementById('#weboffice-zone');
    let ins = aliyun.config({ mount, url: tokenInfo.WebofficeURL });
    ins.setToken({ token: tokenInfo.AccessToken });
  }
</script>
</body>
</html>
